entry: consider ascent and descent when requesting height
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 11 Apr 2014 19:13:11 +0000 (12:13 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 12 Apr 2014 01:58:16 +0000 (18:58 -0700)
Commit d05191a010bcd9871b0155a785989192967c692b change the height
requisition to be completely dependent on the PangoLayout, but that
breaks when the font has special characters with different metrics.
Use the maximum between the two instead.

https://bugzilla.gnome.org/show_bug.cgi?id=728054

gtk/gtkentry.c

index dc9756fe985b0dbdd8454d436d5ad95fcf4f8941..3fd19397c8658b03048607eda0e7f1fce9486442 100644 (file)
@@ -3452,6 +3452,7 @@ gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
   _gtk_entry_get_borders (entry, &borders);
   pango_layout_get_pixel_size (layout, NULL, &height);
 
+  height = MAX (height, PANGO_PIXELS (priv->ascent + priv->descent));
   height += borders.top + borders.bottom;
 
   baseline = pango_layout_get_baseline (layout) / PANGO_SCALE;